package com.cskaoyan.model.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class BaseRespVO<T> {
    private Integer code;
    private String message;
    private T data;

    public static BaseRespVO<Object> ok() {
        return new BaseRespVO<>(0, "OK", null);
    }

    public static <T> BaseRespVO<T> ok(T data) {
        return new BaseRespVO<>(0, "OK", data);
    }

    public static BaseRespVO<Object> error(String message) {
        return new BaseRespVO<>(10000, message, null);
    }
}
